{% extends 'base.html' %}
{% load static %}
{% block mycss %}
    <link rel="stylesheet" type="text/css" href="{% static 'js/plugins/queryCity/css/cityLayout.css' %}">
    {% block mycss1 %}
    {% endblock %}
{% endblock %}


{% block middle %}
    <div class="middle companyheader">
        <div class="wp">
            <img class="fl" style="width: 112px;height: 103px" src="{% static 'images/org.png' %}"/>
            <div class="head fl">
                <h1>
                    {{ org.name }}
                    <img src="{% static 'images/authentication.png' %}"/>
                    <img src="{% static 'images/gold.png' %}"/>
                </h1>
                <p class="fl">
                    <span class="fl" style="margin-top:8px;color:#848484;">推荐指数： </span>
                    <span class="precision company-credit" data-star-scope="5.0"></span>
                    <span class="key">5.0</span>
                </p>
            </div>
            <div class="btn fr collectionbtn  notlogin" data-favid="22" data-fav-type="1" id="love">
                 {% if love_status %}取消收藏{% else %}收藏{% endif %}
            </div>

        </div>
    </div>
{% endblock %}

{% block content %}
    <section>
	<div class="wp">
		<ul  class="crumbs">
            <li><a href="/">首页</a>></li>
			<li><a href="/">课程机构</a>></li>
			<li>{% block breach %}机构首页{% endblock %}</li>
		</ul>
	</div>
</section>
    <section>
	<div class="wp list personal_list comp">
		<div class="left">
			<ul>
				<li {% if detail_type == 'home' %}class="active2" {% endif %}><a href="{% url 'orgs:org_detail' org.id %}">机构首页</a></li>
                <li {% if detail_type == 'course' %}class="active2" {% endif %}><a href="{% url 'orgs:org_detail_course' org.id %}">机构课程</a></li>
                <li {% if detail_type == 'desc' %}class="active2" {% endif %}><a href="{% url 'orgs:org_detail_desc' org.id %}">机构介绍</a></li>
                <li {% if detail_type == 'teacher' %}class="active2" {% endif %}><a href="{% url 'orgs:org_detail_teacher' org.id %}">机构讲师</a></li>
			</ul>
		</div>
        {% block right %}
        {% endblock %}
    </div>
</section>
{% endblock %}

{% block myjs %}
    <script type="text/javascript" src="{% static 'js/plugins/jquery.raty.js' %}"></script>
    <script type="text/javascript">
$(function(){
    var $precision = $('.precision'),
        score = $precision.attr('data-star-scope'),
        option =  {
                    half		: true,
                    path		: '{% static '/images/' %}',
                    precision	: true,
                    size		: 24,
                    starOff		: 'g_star.png',
                    starOn		: 'r_star.png',
                    starHalf	: 'h_star.png',
                    hints       : ['极差', '差', '一般', '好评', '非常满意'],
                    noRatedMsg  : '暂时还未获得评价！',
                    readOnly    : true,
                    score       : score
                };
    $precision.raty(option);

    $('#love').click(function () {
        var love_id = {{  org.id }};
        var love_type = 1;
        $.ajax({
            url: '{% url "operations:user_love" %}',
            type: 'GET',
            data: {
                "love_id": love_id,
                "love_type": love_type,
            },
            success: function (callback) {
                if (callback.status == 'ok'){
                    $('#love').text(callback.msg)
                } else if (callback.status == 'nologin' ) {
                    window.location.href = '{% url 'users:user_login' %}'
                }else {
                    alert(callback.msg)
                }
            }
        })
    })
})
    </script>
    <script type="text/javascript">
$(function() {
    $('.recordbtn1').click(function(){
        $('.recordbox1').show();
    });
    $('.recordbtn2').click(function(){
        $('.recordbox2').show();
    });

    $('.imgslide').unslider({
        speed: 500,               //  The speed to animate each slide (in milliseconds)
        delay: 3000,              //  The delay between slide animations (in milliseconds)
        complete: function() {},  //  A function that gets called after every slide animation
        keys: true,               //  Enable keyboard (left, right) arrow shortcuts
        dots: true,               //  Display dot navigation
        fluid: false              //  Support responsive design. May break non-responsive designs
    });
    var unslider = $('.imgslide').unslider();
    $('.unslider-arrow').click(function() {
        var fn = this.className.split(' ')[1];
        unslider.data('unslider')[fn]();
    });
});
</script>
    {% block myjs1 %}{% endblock %}
{% endblock %}
